<section class="content-wrapper">
	<div class="content-container container">
		<div class="breadcrum-container">
			<ul>
				<li><a href="#" title="Home">Home</a></li>
				<li>Htc  Mobile  1120</li>
			</ul>
		</div>
		<div class="main">
			
			<div class="product-info-box">
				<div class="product-essential">
					<div class="product-img-box">
						<p class="product-image-zoom">
							<img src="<?php echo $this->product['image']; ?>"  alt="Image" title="Image" />
						</p>
						<?php if($this->images): ?>
                        <p>
							<?php echo $this->translate('Click on above image to view full picture'); ?>
						</p>
                        <div class="img-slider">
							<a href="#" title="Prev" class="prev slider-btn"><img src="images/prev_img_btn.png" title="Prev" alt="Prev" /></a>
							<a href="#" title="Next" class="next slider-btn"><img src="images/next_img_btn.png" title="Next" alt="Next" /></a>
							<ul id="moreView">
								<li><a class="ajax" href="images/view_img.png"><img src="images/small_img.png" alt="" title="" /></a></li>
                                <li><a class="ajax" href="images/view_img.png"><img src="images/small_img.png" alt="" title="" /></a></li>
		                        <li><a class="ajax" href="images/view_img.png"><img src="images/small_img.png" alt="" title="" /></a></li>
                                <li><a class="ajax" href="images/view_img.png"><img src="images/small_img.png" alt="" title="" /></a></li>
                                <li><a class="ajax" href="images/view_img.png"><img src="images/small_img.png" alt="" title="" /></a></li>
		                        <li><a class="ajax" href="images/view_img.png"><img src="images/small_img.png" alt="" title="" /></a></li>				
							</ul>
						</div>
                        <?php endif; ?>
					</div>
					<div class="product-shop">
						<h3 class="product-name"><?php echo $this->product['name']; ?></h3>
						<div class="price-box">
                		    <span class="price">
                                <?php echo number_format($this->product['price'], 0, null, "."); ?>
                                <?php echo $this->translate('currency'); ?>
                            </span>
                            <?php /*if($this->product['quantity'] > 5): ?>
                                <span class="availability">
                                    <?php echo $this->translate('in stock'); ?>
                                </span>
                            <?php else: ?>
    							<span class="unavailability">
                                    <?php echo $this->translate('out of stock'); ?>
                                </span>
                            <?php endif;*/ ?>
				        </div>
						<div class="model-block">
							<p>
								<span><?php echo $this->translate('brand') ?>: </span><?php echo $this->product['brand_name']; ?>
							</p>
                            <p>
								<span><?php echo $this->translate('category') ?>: </span><?php echo $this->product['category_name']; ?>
							</p>
						</div>
						<div class="add-to-cart-box">
							<span class="qty-box">
								<label for="qty"><?php echo $this->translate('quantity') ?>:</label>
								<input type="text" value="1" maxlength="12" id="qty" class="input-text qty" name="qty" />
							</span>
                            
                            <div class="clear"></div>
                            <br />
                            
                            <?php if($this->product['quantity'] > 5): ?>
                                <button id="addCart" class="form-button" title="<?php echo $this->translate('add to cart'); ?>">
                                    <?php echo $this->translate('add to cart'); ?>
                                </button>
                            <?php else: ?>
    							<button class="form-button unavailability">
                                    <?php echo $this->translate('out of stock'); ?>
                                </button>
                            <?php endif; ?>
                            
                            <div class="clear"></div>
                            <br />
                            
                            <button id="checkout" class="form-button" title="<?php echo $this->translate('checkout'); ?>">
                                <span>
                                    <?php echo $this->translate('checkout'); ?>
                                </span>
                            </button>
                            
                            <div class="nganluong">
                                <img src="https://www.nganluong.vn/webskins/skins/nganluong/images/CertifiedLogo-r.png" />
                            </div>
                            
							<ul class="add-to-box">
								<li>
                                    <a href="#" title="Add to Wishlist" class="add-wishlist">
                                        Add to Wishlist
                                    </a>
                                </li>
								<li>
                                    <a href="#" title="Add to Compare" class="add-compare">
                                        Add to Compare
                                    </a>
                                </li>
								<li>
                                    <a href="#" title="Email to a Friend" class="email-friend">
                                        Email to a Friend
                                    </a>
                                </li>
								<li class="last">
                                    <a href="images/size_chart.gif" title="Size Guide" class="size-guide ajax">
                                        Size Guide
                                    </a>
                                </li>
							</ul>
						</div>
					</div>
				</div>
			</div>
            <aside class="right">
				<ol class="pro-slider-btn">
					<li>
                        <a href="#" title="Prev">
                            <img src="<?php echo $this->templateURL; ?>/images/pro_prev_btn.png" title="Prev" alt="Prev" />
                        </a>
                    </li>
					<li>
                        <a href="#" title="Next">
                            <img src="<?php echo $this->templateURL; ?>/images/pro_next_btn.png" title="Next" alt="Next" />
                        </a>
                    </li>
				</ol>
				<ul class="right-img">
					<li>
                        <a href="#" title="Image">
                            <img src="<?php echo $this->templateURL; ?>/images/view_right_img01.png" title="Image" alt="Image" />
                        </a>
                    </li>
					<li>
                        <a href="#" title="Image">
                            <img src="<?php echo $this->templateURL; ?>/images/view_right_img02.png" title="Image" alt="Image" />
                        </a>
                    </li>
					<li>
                        <a href="#" title="Image">
                            <img src="<?php echo $this->templateURL; ?>/images/view_right_img03.png" title="Image" alt="Image" />
                        </a>
                    </li>
				</ul>
			</aside>
			<section  class="product-collateral">
            	<script type="text/javascript">
					$(function(){
						var tabContainers=$('section.product-collateral > div.commonContent');
						tabContainers.hide().filter(':first').show();
						$('section.product-collateral ul.tab-block a').click(function(){
							tabContainers.hide();
							tabContainers.filter(this.hash).show();
							$('section.product-collateral ul.tab-block a').removeClass('active');
							$(this).addClass('active');
							return false;
							}).filter(':first').click();
						});
					</script>
				<ul class="tab-block">
					<li><a href="#pro-detail" title="Description" class="active">Description</a></li>
				</ul>
				<div id="pro-detail" class="pro-detail commonContent">
					<?php echo $this->product['description']; ?>
				</div>
			</section>
			<div class="like-pro-block">
				<div class="title-block">
					<h2><?php echo $this->translate('like products'); ?></h2>
				</div>
				<div class="like-pro">
					<ul id="like-pro" class="product-grid">
                        <?php if($this->likeProducts): ?>
    						<?php foreach($this->likeProducts as $product): ?>
                                <li>
        							<div class="pro-img">
                                        <img title="Freature Product" alt="Freature Product" src="<?php echo $product->image; ?>" />
                                    </div>
        							<div class="pro-detail-block">
        								<h4 class="pro-name">
                                            <a href="<?php echo $this->url(array('product_id' => $product->id, 'product_name' => $product->name), 'product_detail', true); ?>">
                                                <?php echo $product->name; ?>
                                            </a>
                                        </h4>
        								<div class="pro-price">
                                            <?php echo number_format($product->price, 0, null, "."); ?><?php echo $this->translate('currency'); ?>
                                        </div>
        							</div>
        						</li>
                            <?php endforeach; ?>
                        <?php endif; ?>
					</ul>
				</div>
			</div>
			<div class="related-pro-block">
				<div class="title-block">
					<h2><?php echo $this->translate('related products'); ?></h2>
				</div>
				<div class="related-pro">
                    <?php if($this->relatedProducts): ?>
    					<ul id="related-pro" class="product-grid">
                            <?php foreach($this->relatedProducts as $product): ?>
                                <li>
        							<div class="pro-img">
                                        <img title="Freature Product" alt="Freature Product" src="<?php echo $product->image; ?>" />
                                    </div>
        							<div class="pro-detail-block">
        								<h4 class="pro-name">
                                            <a href="<?php echo $this->url(array('controller' => 'product', 'action' => 'detail', 'product_id' => $product->id), null, true); ?>">
                                                <?php echo $product->name; ?>
                                            </a>
                                        </h4>
        								<div class="pro-price">
                                            <?php echo number_format($product->price, 0, null, "."); ?><?php echo $this->translate('currency'); ?>
                                        </div>
        							</div>
        						</li>
                            <?php endforeach; ?>
    					</ul>
                    <?php endif; ?>
				</div>
			</div>
		</div>
		<div class="clearfix"></div>
		<div class="news-letter-container">
			<div class="free-shipping-block">
				<h1>ENJOY FREE SHIPPING</h1>
				<p>on all orders as our holiday gift for you!</p>
			</div>
			<div class="news-letter-block">
				<h2>SIGN UP FOR OUR NEWSLETTER</h2>
				<input type="text" value="Enter email address" title="" />
				<input type="submit" value="Submit" title="Submit" />
			</div>
		</div>
	</div>
</section>
<script>
function loadCart(){
    $.ajax({
        type: "post",
        url: "<?php echo $this->url(array(), 'cart_load', true); ?>",
        success: function(result){
            $(".cart-block").empty();
            $(".cart-block").html(result);
        }
    });
}

$(document).ready(function(){
    $(".banner-wrapper").remove();
    
    $("input[id='qty']").priceFormat({
        prefix: '',
        clearPrefix: true,
        thousandsSeparator: '.',
        centsLimit: 0,
        limit: 3
    });
    
    $("#addCart").click(function(){
        var id = <?php echo $this->product['id']; ?>;
        var qty = $("#qty").unmask();
        
        if(qty > 0){
            $.ajax({
                type: "post",
                url: "<?php echo $this->url(array(), 'cart_add', true); ?>",
                data: {'id': id, 'quantity': qty},
                success: function(result){
                    if(result.error == false){
                        loadCart();
                        alert("<?php echo $this->translate('add to cart success'); ?>");
                    }else{
                        alert(result.message);
                    }
                }
            });
        }else{
            alert("<?php echo $this->translate('enter quantity'); ?>");
            $("#qty").focus();
        }
    });
    
    $("#checkout").click(function(){
        var url = "<?php echo $this->url(array(), 'cart', true); ?>";
        window.location = url;
    });
});
</script>